<template>
    <div class="shopInfo">
      <div class="shop-title">
        <img :src="shopInfo.logo" alt="">
        <span>{{shopInfo.name}}</span>
      </div>
      <div class="shop-content">
        <div class="content-item left" >
          <div class="content-item-item">
            <p style="font-size: 16px">{{shopInfo.sells | number}}</p>
            <p>总销量</p>
          </div>
          <div class="content-item-item" >
            <p style="font-size: 16px">{{shopInfo.goodsCount}}</p>
            <p>全部宝贝</p>
          </div>
          <div  style="border-right: 1px solid #F0F0F0;height: 40px "></div>
        </div>
        <div class="content-item right">
          <div class="child-right">
            <div>描述相符</div>
            <div>价格合理</div>
            <div>质量满意</div>
          </div>
          <div class="child-right">
            <div style="color: #00DB00">4.67</div>
            <div style="color: #FF2D2D">5</div>
            <div style="color: #00DB00">4.71</div>
          </div>
          <div class="child-right">
            <div style="color: white;background-color: #00DB00">低</div>
            <div style="color: white;background-color: #00DB00">高</div>
            <div style="color: white;background-color: #00DB00">低</div>
          </div>
        </div>
      </div>
      <div class="shop-address">
        <div>进店逛逛</div>
      </div>
      <div class="shop-other"></div>
    </div>
</template>

<script>
    export default {
        name: "ShopInfo",
        props:{
            shopInfo:{
                type:Object,
                default(){
                    return {}
                }
            }
        },
        filters: {
            //保留2位小数点过滤器 不四舍五入
            number(value) {
                if(value>=10000){
                    let num = (value / 10000).toString()
                    return num.substring(0, 3)+'万';
                }
                return value
            }
        },
    }
</script>

<style scoped>
  .shop-title img{
    border-radius: 50px;
    width: 38px;
    height: 38px;
    vertical-align: middle;
    margin-right: 8px;
    border: 2px solid #F0F0F0;
  }
  .shop-title{
    margin-top: 26px;
    margin-left: 8px;
  }
  .shop-content{
    display: flex;
    padding-bottom: 15px;
  }
  /*.shop-content :first-child {*/
  /*  border-right: 1px solid beige;*/
  /*}*/
  .content-item{
    flex: 1;
    display: flex;
    font-size: 13px;
    margin-right: -3px;
  }
  .content-item.left{
    padding-top: 30px;
    padding-left: 25px;
    text-align: center;
  }
  .content-item.right{
    padding-top: 5%;
    padding-left: 5%;
  }
  .content-item-item{
    flex:1;
  }
  .content-item-item p{
    margin-bottom: 6px;
  }
  .child-right{
    margin: 0 5px;
  }
  .child-right div{
    margin: 7px 0;
  }
  .shop-address div{
    width: 149px;
    background-color: #F0F0F0;
    border-radius: 14px;
    margin: 0 auto;
    height: 32px;
    line-height: 32px;
    text-align: center;
  }
</style>
